﻿/*
 * Project WarRoom
 * https://warroom.codeplex.com/
 *
 * Copyright 2012, Yi-Fan Liao
 *
 * This file is part of Project WarRoom.
 *
 * Project WarRoom is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as published by
 * the Free Software Foundation.
 * 
 * Project WarRoom is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Project WarRoom.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Date: Fri Aug 24 21:41:08 2012 +0800
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Hosting;

/// <summary>
/// XmlUtility 的摘要描述
/// </summary>
public class XmlUtility
{
    public XmlUtility()
    {
        //
        // TODO: 在此加入建構函式的程式碼
        //
    }

    public int GetMaxNumber()
    {
        int maxNumber = 0;

        return maxNumber;
    }

    public string InitializeFilePath(string virtualPath)
    {
        // Initialize _XmlFileName and make sure the path
        // is app-relative
        string filePath;

        if (!String.IsNullOrEmpty(virtualPath))
        {
            filePath = VirtualPathUtility.Combine(VirtualPathUtility.AppendTrailingSlash(HttpRuntime.AppDomainAppVirtualPath), virtualPath);

            filePath = HostingEnvironment.MapPath(filePath);

            return filePath;
        }
        else { return string.Empty; }
    }
}
